package com.cetccst.securitysuite.fragments.viewmodel;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.cetccst.securitysuite.mqtt.SSMqtt;

public class MqttViewModel extends ViewModel {
    public MutableLiveData<String> content = new MutableLiveData<>();

    public void registerMqtt() {
        SSMqtt.getInstance().subscribe(SSMqtt.TOPIC_TEST, (message) -> content.postValue(content.getValue() + "\n" +
                SSMqtt.TOPIC_TEST + ":" + message));
    }
}
